home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Topik / Topik - Disk 24 - Productivity (19xx)(Topik Public Domain)(PD)[WB].zip / Topik - Disk 24 - Productivity (19xx)(Topik Public Domain)(PD)[WB].adf / BlackBook / blkbook.doc < prev    next >
Text File  |  1990-02-28  |  5KB  |  181 lines

  1.  
  2. ***   TOPIK Note : The C source and makefiles etc can be found in this
  3.  *    directory.
  4.  *
  5.  
  6.  
  7.  
  8.                   ------------------------------------
  9.                   *** Little Black Book © 1987 Lcc ***
  10.                   ------------------------------------
  11.  
  12.    This program is presented in the spirit of keeping shareware alive.
  13.  
  14.    You may freely copy and distribute, for non-commercial purposes, both
  15. Little Black Book and the limited file handler library (bfile.lib) provided
  16. that this documentation accompanies the programs and that no charge is made
  17. for copying and distribution.
  18.  
  19.    If you find these programs useful please send your contribution to the
  20. address below.  If you desire the full-blown bfile library on disk complete
  21. with source code (bfile is written in 'C' and is not Amiga specific) -
  22.  
  23.                 Please send the nominal fee of $30¹ to:
  24.  
  25.                           Craig Nelson
  26.                           Log Cabin Computer
  27.                           921 Arcola Ct PP
  28.                           Granbury, TX  76048
  29.  
  30.  ¹ A bona fide job offer may be substituted for cash as this programmer is
  31.    currently unemployed (817) 573-7304.
  32.  
  33.  
  34.                        Notes, caveats and stuff
  35.                       --------------------------
  36.  
  37. Little Black Book:
  38. ------------------
  39.  * Because of special keyboard/mouse handling, runs only under WorkBench
  40.    release 1.2 (this does not apply to bfile.lib) 
  41.  
  42.  * Set up for 80 column because that's my preference
  43.  
  44.  * If the display flashes it's either your imagination or the beginning or
  45.    end of file has been reached
  46.  
  47.  * For the most part, either the keyboard or the mouse may be used
  48.    interchangeably - you'll get the idea just by playing around
  49.  
  50.    <Right Mouse>     move pointer to the bottom of window
  51.  
  52.    <RETURN>          when the pointer is at the bottom of window enters
  53.                      edit mode
  54.  
  55.    <CTRL><RETURN>    exits edit mode
  56.  
  57.    <Right AMIGA><Q>  restores a field
  58.  
  59.    <Right AMIGA><X>  clears a field
  60.  
  61.    <Right Cursor>    next record
  62.  
  63.    <Left Cursor>     previous record
  64.  
  65.    F1 - 'FND'        finds the first occurence > or = to entry typed
  66.                      (the record key is upper case so 'johnson' = 'JOHNSON')
  67.  
  68.    F2 - 'SAV'        saves changes made to an existing record
  69.  
  70.    F3 - 'ADD'        adds a new record
  71.  
  72.    F4 - 'DEL'        deletes a record
  73.  
  74.  
  75. bfile.lib:
  76. ----------
  77.  * bfile.lib is a B+ tree ISAM file handling package written in 'C'
  78.  
  79.  * The limited version has the following restrictions:
  80.  
  81.    - 1 data file
  82.    - Max record length = 512 bytes
  83.    - Max number of entries = 32K
  84.  
  85.    - 1 index file
  86.    - Max key length = 32 bytes
  87.  
  88.    - provides only limited error checking
  89.  
  90.  * A brief synopsis of the supported functions is as follows:
  91.  
  92.    Given -
  93.            typedef  char  BFILE[100];
  94.  
  95.            external int   BFILE_OK;
  96.  
  97.                     BFILE DataFile, IndexFile;
  98.                     char  FileName[], RecordBuffer[], RecordKey[];
  99.                     int   RecordLength, RecordNumber, KeyLength, Duplicates;
  100.  
  101.  * Create a new data file
  102.  
  103.            MakeFile(&DataFile,&FileName,RecordLength);
  104.  
  105.  * Open an existing data file
  106.  
  107.            OpenFile(&DataFile,&FileName,RecordLength);
  108.  
  109.  * Close a data file
  110.  
  111.            CloseFile(&DataFile);
  112.  
  113.  * Add a new data record
  114.  
  115.            AddRec(&DataFile,&RecordNumber,&RecordBuffer);
  116.  
  117.  * Delete a data record
  118.  
  119.            DeleteRec(&DataFile,RecordNumber);
  120.  
  121.  * Read a data record
  122.  
  123.            GetRec(&DataFile,RecordNumber,&RecordBuffer);
  124.  
  125.  * Write a data record
  126.  
  127.            PutRec(&DataFile,RecordNumber,&RecordBuffer);
  128.  
  129.  * Return the total number of records in a file (including deleted records)
  130.  
  131.            FileRecs(&DataFile);
  132.  
  133.  * Return the total number of records in a file that are in use
  134.  
  135.            UsedRecs(&DataFile);
  136.  
  137.  * Create a new index file
  138.  
  139.            MakeIndex(&IndexFile,&FileName,KeyLength,Duplicates);
  140.  
  141.  * Open an existing index file
  142.  
  143.            OpenIndex(&IndexFile,&FileName,KeyLength,Duplicates);
  144.  
  145.  * Close an index file
  146.  
  147.            CloseIndex(&IndexFile);
  148.  
  149.  * Add a key to an index file
  150.  
  151.            AddKey(&IndexFile,RecordNumber,&RecordKey);
  152.  
  153.  * Delete a key from an index file
  154.  
  155.            DeleteKey(&IndexFile,&RecordNumber,&RecordKey);
  156.  
  157.  * Reset an index file to the beginning
  158.  
  159.            StartKey(&IndexFile);
  160.  
  161.  * Return the key and record number that exactly matches the specified key
  162.  
  163.            FindKey(&IndexFile,&RecordNumber,&RecordKey);
  164.  
  165.  * Return the key and record number that is < or = to the specified key
  166.  
  167.            SearchKey(&IndexFile,&RecordNumber,&RecordKey);
  168.  
  169.  * Return the next key and record number
  170.  
  171.            NextKey(&IndexFile,&RecordNumber,&RecordKey);
  172.  
  173.  * Return the previous key and record number
  174.  
  175.            PrevKey(&IndexFile,&RecordNumber,&RecordKey);
  176.  
  177.    (Most functions set BFILE_OK to TRUE if no error occurred and FALSE if
  178.    there was an error)
  179.  
  180.                                - - -
  181.